﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace YmSoft.WPF.Modbus
{
    /// <summary>
    /// WinModbus.xaml 的交互逻辑
    /// </summary>
    public partial class WinModbus : Window
    {
        public WinModbus()
        {
            InitializeComponent();

            this.Closing += WinModbus_Closing;
        }

        void WinModbus_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var mvModbus = CrlModbus.TryFindResource("myMVModbus") as MVModbus;
            if (mvModbus == null)
            {
                return;
            }
            mvModbus.Stop();
        }

    }
}
